home *** CD-ROM | disk | FTP | other *** search
- Subject: Re:Undo Set Property
- Sent: 8/6/96 8:21 PM
- Received: 8/7/96 8:55 AM
- From: Greg Friedman, friedman@cognosis.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- Serge Froment wrote:
- > Dear ODF Experts:
- >
- > Setting some of the properties of my part do modify other properties and
- > this is not taken care by FW_CSetPropertyCommand. This command object is
- > created by FW_CPropertyDesignator::DoAESetData, which I cannot figure how
- > to override.
- >
- > Although it may seem strange that properties have side effects on other
- > properties, this is natural for my part content.
- >
- > Is there a solution?
-
- I'm not sure you need to override FW_CSetPropertyCommand. When a
- FW_CSetPropertyCommand is performed, the SetProperty method of the object
- whose property is being set is called. SetProperty is virtual. I suspect
- you'll be able to implement the functionality you need by override
- SetProperty and/or GetProperty in your part. There is nothing stopping you
- from doing whatever you want when these methods are called. I think this
- method is the most straightforward, and you should be able to do what you
- want.
-
- If you _really_ want to mess with FW_CSetProperty command, you'll have to
- do more work. You'll need to override the GetContainedObject method of the
- scriptable object whose property is being set. Within that method, you'll
- need to return a subclass (which you define and implement) of
- FW_CPropertyDesignator, that overrides DoAESetData. When your subclass's
- DoAESetData method is called, you'll have to create and execute either a
- subclass of FW_CSetPropertyCommand, or a subclass of FW_CCommand (that you
- define and implement). This subclass can do whatever you want in its DoIt,
- UndoIt, and RedoIt method. Be _very_ careful to make sure that you
- implement a scheme for reference counting so that objects involved in undo
- are kept around when necessary, and are deleted when you are through with
- them.
-
- Greg.
-
-
- _________________________________________________________
- Greg Friedman ODF Engineering Apple Computer
-
-
-